package cn.cubix.flow.controller.dto.workflow;

import lombok.Data;
import lombok.experimental.Accessors;
import org.flowable.engine.repository.Deployment;

import java.util.Date;

@Data
@Accessors(chain = true)
public class DeploymentDto {
    protected String id;
    protected String key;
    protected String name;
    protected String parentDeploymentId;
    protected Date DeploymentTime;
    protected String category;
    protected String tenantId;
    protected String bpmnXml;

    public static DeploymentDto from(Deployment deployment){
        return new DeploymentDto()
                .setId(deployment.getId())
                .setKey(deployment.getKey())
                .setName(deployment.getName())
                .setParentDeploymentId(deployment.getParentDeploymentId())
                .setDeploymentTime(deployment.getDeploymentTime())
                .setCategory(deployment.getCategory())
                .setTenantId(deployment.getTenantId());
    }
}
